home *** CD-ROM | disk | FTP | other *** search
/ Chip 1996 October / CHIP Ekim 1996.iso / winbatch / dollars.wb_ < prev    next >
Text File  |  1995-09-18  |  3KB  |  93 lines

  1. goto doit
  2. [buckdata]
  3. Argentina(Pesos)=1.01
  4. Australia(Dollars)=0.7145
  5. Austria(Shilling)=0.0808
  6. Belgium(Franc)=0.02755
  7. Brazil(Cruzeiro Real)=0.002
  8. England(Pound)=1.4825
  9. Canada(Dollar)=0.7439
  10. France(Franc)=0.16764
  11. German(Mark)=0.5682
  12. HongKong(Dollar)=0.12932
  13. Italy(Lira)=0.0005894
  14. Japan(Yen)=0.009195
  15. Mexico(Peso)=0.322165
  16. Netherlands(Guilder)=0.5072
  17. NewZealand(Dollar)=0.573
  18. Norway(Krone)=0.1325
  19. Singapore(Dollar)=0.6288
  20. SouthAfrica(Rand)=0.22
  21. Spain(Peseta)=0.007033
  22. Sweden(Krona)=0.1253
  23. Switzerland(Franc)=0.6803
  24. Taiwan(Dollar)=0.037836
  25.  
  26.  
  27. [dummy]
  28. ; NOTE:  This is an example of a self-referencing WBT file that CANNOT BE COMPILED
  29. ; with the WinBatch Compiler.  To be able to compile something like this, the currency
  30. ; exchange table must be moved to another file.
  31. :doit
  32. Message("Currency Converter","This file converts between US and International Currencies.%@CRLF%It is only as accurate as the table embedded in the WBT file.%@CRLF%Review table and update from time to time from your local newspaper.")
  33.  
  34. Decimals(2)
  35. tab=num2char(9)
  36. OrigDir=DirGet()
  37. IniFile=strcat(OrigDir,"Intl Money Conversions.wbt")
  38. MucksFormat=`WWWDLGED,5.0`
  39.  
  40. MucksCaption=`Buck Basher`
  41. MucksX=67
  42. MucksY=66
  43. MucksWidth=247
  44. MucksHeight=130
  45. MucksNumControls=8
  46.  
  47. Mucks01=`4,2,90,122,ITEMBOX,Countries,DEFAULT`
  48. Mucks02=`170,10,64,DEFAULT,EDITBOX,Bucks,""`
  49. Mucks03=`110,10,60,DEFAULT,STATICTEXT,DEFAULT,"Enter Amount"`
  50. Mucks04=`100,108,124,DEFAULT,PUSHBUTTON,DEFAULT,"&Quit",0`
  51. Mucks05=`100,90,124,DEFAULT,PUSHBUTTON,DEFAULT,"Foreign currency to US $",2`
  52. Mucks06=`100,72,124,DEFAULT,PUSHBUTTON,DEFAULT,"US $ to Foreign currency",1`
  53. Mucks07=`100,32,130,DEFAULT,VARYTEXT,stat1,"Da France money is worth"`
  54. Mucks08=`100,46,132,DEFAULT,VARYTEXT,stat2,"us buck two 95"`
  55.  
  56. BigList=IniItemizePvt("buckdata",IniFile)
  57. stat1=""
  58. stat2=""
  59.  
  60. :top
  61.  
  62. Countries=BigList
  63.  
  64.  
  65. ButtonPushed=Dialog("Mucks")
  66. ;i=strtrim(ItemCount("Countries",tab))
  67. where=ItemExtract(1,Countries,tab)
  68. if where==""
  69.     Message("Bucks","Must just choose one country at a time")
  70.     goto top
  71. endif
  72.  
  73. if !IsNumber(Bucks)             
  74.      Message("Bucks","No value entered")
  75.      goto top
  76. endif
  77.  
  78. DaRate=IniReadPvt("buckdata",where,99999,IniFile)
  79.  
  80. switch ButtonPushed
  81.     case 1     ;US$ to foreign
  82.        Ducks=Bucks/DaRate          
  83.        stat1="US$ %Bucks% is worth"
  84.        stat2="%Ducks% in %where%"  
  85.        break                       
  86.     case 2     ; Foreign to US$
  87.        Ducks=Bucks*DaRate
  88.        stat1="%where% %Bucks% is worth"
  89.        stat2="%Ducks% in US Dollars"
  90.        break
  91. endswitch       
  92. goto top
  93.